import request from '/@/utils/request';




export function useMailApi() {
    return {


        /**
         * 查询邮箱配置
         * @param params 
		 * @returns 
         */
        queryMailboxConfig(params: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/config`,
                method: 'get',
                params: params,
            })
        },

        /**
         * 更新邮件配置
        *  @param params 
		 * @returns 
         */
        updateMailboxConfig(params: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/config`,
                method: "put",
                data: params
            });
        },

        /**
         * 新增邮件配置
		 * @param params 
		 * @returns 
         */
        addMailboxConfig(params: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/config`,
                method: "post",
                data: params
            });
        },


        /**
         * 发送邮件
		 * @param params 
		 * @returns 
         */
        toMailbox(to: any, userNametwo: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/config/test?to=${to}&userName=${userNametwo}`,
                method: 'get'
            })
        },


        /**
         * 查询邮件模板
         * @param params
		 * @returns
         */
        queryMailboxTemplate(params: any) {

            return request({
                url: `/COMMON-SERVICE/email/admin/template`,
                method: 'get',
                params: params,
            })
        },

        /**
         * 新增邮件模板
         * @param params
		 * @returns
         */
        addMailboxTemplate(params: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/template`,
                method: "post",
                data: params
            });
        },


        /**
         * 更新邮件模板
         * @param params
		 * @returns
         */
        updateMailboxTemplate(params: any) {
            return request({
                url: `/COMMON-SERVICE/email/admin/template`,
                method: "put",
                data: params
            });
        }

    }
}